package com.sky.bridge.notBridge;

import java.math.BigDecimal;

/**
 * @author : wushikai
 * <p>
 * date : 2020-08-12
 */

class HuaweiPad {

    String name;
    BigDecimal price;

    public HuaweiPad(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}




class HuaweiLaptop {

    String name;
    BigDecimal price;

    public HuaweiLaptop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}


/*华为台式机*/
class HuaweiDesktop {

    String name;
    BigDecimal price;

    public HuaweiDesktop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}






/*联想平板*/
class Lenovopad{

    String name;
    BigDecimal price;

    public Lenovopad(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}

class LenovoLaptop{

    String name;
    BigDecimal price;

    public LenovoLaptop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}





class LenovoDesktop{

    String name;
    BigDecimal price;

    public LenovoDesktop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}







/*神船平板电脑*/
class ShenchuanPad{

    String name;
    BigDecimal price;

    public ShenchuanPad(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}

class ShenchuanLaptop{

    String name;
    BigDecimal price;

    public ShenchuanLaptop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}





class ShenchuanDesktop{

    String name;
    BigDecimal price;

    public ShenchuanDesktop(String name, String price) {
        this.name = name;
        this.price = new BigDecimal(price);
    }

    void sale() {

        System.out.println("销售" + name + "  ;   价格是 "+ price.toString());

    }
}











/*---------------电脑商城- 未使用桥接模式-----------------*/
public class ComputerMarket {

    public static void main(String[] args) {


        sale();

    }

    public  static void sale(){
        //一般都是工厂模式传过来的电脑
        HuaweiLaptop huaweiLaptop = new HuaweiLaptop("华为笔记本电脑", "20000");
        huaweiLaptop.sale();

        ShenchuanDesktop shenchuanDesktop = new ShenchuanDesktop("神船台式机", "5000");
        shenchuanDesktop.sale();
    }

}





/*---------------未使用桥接模式, 创建的类数量是 n*m --------------------*/















